#pragma once
#include "../Utilities/utilities.h"
#include "Defines.h"

class cCamera
{
protected:
	static cCamera* s_Instance;
	//CObjectNode *m_objMap;

	cCamera();
	cCamera(const cCamera &){}
	cCamera& operator =(const cCamera &){}
	virtual ~cCamera(){};

	Matrix m_maView;
	Matrix m_maProjection;

public:
	// Methods
	Matrix GetViewMatrix();
	Matrix GetProjectionMatrix();
	Matrix GetViewProjectionMatrix();

	Vector3 GetXAxis();
	Vector3 GetYAxis();
	Vector3 GetZAxis();

	void Update(const float &deltaTime);
	void Reset();
	
	Matrix ComputeViewMatrix();
	Matrix ComputeWorldMatrix();

	void MoveForward();
	void MoveForward(float &delta);
	
	void MoveBack();
	void MoveBack(float &delta);
	
	void MoveLeft();
	void MoveLeft(float &delta);

	void MoveRight();
	void MoveRight(float &delta);

	void MoveUp();
	void MoveUp(float &delta);

	void MoveDown();
	void MoveDown(float &delta);

	void RotateX(float &angle);
	void RotateY(float &angle);

	// Static methods
	static cCamera* GetInstance();
	static void DestroyInstance();

	// Propertices
	Vector3 m_v3CamPos;
	Vector3 m_vUp;
	Vector3 m_v3Target;
	float m_fSpeed;
	
	float m_fNear, m_fFar;
};